window.onload = function(){
	var music = document.getElementById("music");
	var audio = document.getElementsByTagName("audio")[0];
	var page1 = document.getElementById("page1");
	var page2 = document.getElementById("page2");
	var page3 = document.getElementById("page3");

	//自动播放停止
	audio.addEventListener("ended",function(event){
		music.setAttribute("class","music_disc");
	},false);
	
	//点击播放音乐
	music.onclick = function(){
		if(audio.paused){
			audio.play();
			this.setAttribute("class","music_disc play");
			//this.style.animationPlayState="running";
		}else{
			audio.pause();
			this.setAttribute("class","music_disc");
			//this.style.animationPlayState="paused";
		}
	};
	/*music.addEventListener("touchstart",function(event){
		if(audio.paused){
			audio.play();
			this.setAttribute("class","music_disc play");
		}else{
			audio.pause();
			this.setAttribute("class","music_disc");
		}
	},false);*/
	
	 page1.onclick = function(){
        this.style.display = "none";
        page2.style.display = "block";
        page3.style.display = "block";
        page3.style.top 	= "100%";

        setTimeout(function() {
            page2.setAttribute("class","page fadeout");
            page3.setAttribute("class","page fadein");
            //page2.style.display = "none";
            //page3.style.display = "block";
        }, 5500);
    };
};